<?php
	include_once('header.php');
	include_once('menu.php');
	include_once('content.php');
?> 

<h3><?php echo $cesta[0]['city'] .' ('.$cesta[0]['organization'].')';  ?></h3>

<?php
					
echo form_open('SluzobneCesty/zmen');
echo form_fieldset();
echo form_hidden('id', $cesta[0]['id']);
echo form_hidden('typ_cesty', $typ_cesty);

echo form_error('city');
echo '<p>' . form_label('Mesto*','city');
echo form_input('city',set_value('city',$cesta[0]['city'])).'</p>';

echo form_error('country');
echo '<p>' . form_label('Štát*','country');
echo form_input('country',set_value('country',$cesta[0]['country'])).'</p>';

echo form_error('organization');
echo '<p>' . form_label('Organizácia*','organization');
echo form_input('organization',set_value('organization',$cesta[0]['organization'])).'</p>';

echo form_error('date_of_arrival');
echo '<p>' . form_label('Dátum príchodu*','date_of_arrival');
echo form_input(array('name'=>'date_of_arrival', 'class'=>'date'),set_value('date_of_arrival',$cesta[0]['date_of_arrival'])).'<small>rok-mesiac-den</small></p>';

echo form_error('date_of_departure');
echo '<p>' . form_label('Dátum odchodu*','date_of_departure');
echo form_input(array('name'=>'date_of_departure', 'class'=>'date'),set_value('date_of_departure',$cesta[0]['date_of_departure'])).'<small>rok-mesiac-den</small></p>';

echo form_hidden('person_id',set_value('person_id',$cesta[0]['person_id']));

echo "<small>Údaje označené * sú povinné!</small>";

echo '<p>'.form_submit('submit', 'Zmen').'</p>';
echo form_fieldset_close();
echo form_close();	

?>
	
<?php
$footer_scripts = '<script type="text/javascript">
jQuery(document).ready(function($) {
    $(\'input[type=text][name=date_of_arrival], input[type=text][name=date_of_departure]\').datepicker({ dateFormat: \'yy-mm-dd\', changeMonth: true, changeYear: true, numberOfMonths: 2, showButtonPanel: true, firstDay: 1, showWeek: true, showOtherMonths: true, selectOtherMonths: true });
    $(\'input[type=text][name=city]\').autocomplete({ source: \'' . site_url('SluzobneCesty/cities') . '\' });
    $(\'input[type=text][name=country]\').autocomplete({ source: \'' . site_url('SluzobneCesty/countries') . '\' });
    $(\'input[type=text][name=organization]\').autocomplete({ source: \'' . site_url('SluzobneCesty/organizations') . '\' });
});
</script>';
include_once('footer.php');
?>